<div class="copies view">
<h2><?php  __('Copy');?></h2>
	<dl><?php $i = 0; $class = ' class="altrow"';?>
		<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Id'); ?></dt>
		<dd<?php if ($i++ % 2 == 0) echo $class;?>>
			<?php echo $copy['Copy']['id']; ?>
			&nbsp;
		</dd>
		<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Loaned'); ?></dt>
		<dd<?php if ($i++ % 2 == 0) echo $class;?>>
			<?php echo $copy['Copy']['loaned']; ?>
			&nbsp;
		</dd>
		<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Created'); ?></dt>
		<dd<?php if ($i++ % 2 == 0) echo $class;?>>
			<?php echo $copy['Copy']['created']; ?>
			&nbsp;
		</dd>
		<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Publication'); ?></dt>
		<dd<?php if ($i++ % 2 == 0) echo $class;?>>
			<?php echo $this->Html->link($copy['Publication']['title'], array('controller' => 'publications', 'action' => 'view', $copy['Publication']['id'])); ?>
			&nbsp;
		</dd>
	</dl>
</div>
<div class="actions">
	<h3><?php __('Actions'); ?></h3>
	<ul>
		<li><?php echo $this->Html->link(__('Edit Copy', true), array('action' => 'edit', $copy['Copy']['id'])); ?> </li>
		<li><?php echo $this->Html->link(__('Delete Copy', true), array('action' => 'delete', $copy['Copy']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $copy['Copy']['id'])); ?> </li>
		<li><?php echo $this->Html->link(__('List Copies', true), array('action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('New Copy', true), array('action' => 'add')); ?> </li>
		<li><?php echo $this->Html->link(__('List Publications', true), array('controller' => 'publications', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('New Publication', true), array('controller' => 'publications', 'action' => 'add')); ?> </li>
		<li><?php echo $this->Html->link(__('List Loans', true), array('controller' => 'loans', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('New Loan', true), array('controller' => 'loans', 'action' => 'add')); ?> </li>
	</ul>
</div>
<div class="related">
	<h3><?php __('Related Loans');?></h3>
	<?php if (!empty($copy['Loan'])):?>
	<table cellpadding = "0" cellspacing = "0">
	<tr>
		<th><?php __('Id'); ?></th>
		<th><?php __('Person Id'); ?></th>
		<th><?php __('User Id'); ?></th>
		<th><?php __('Created'); ?></th>
		<th><?php __('Modified'); ?></th>
		<th><?php __('Estimated Devolution'); ?></th>
		<th><?php __('Devolution Date'); ?></th>
		<th class="actions"><?php __('Actions');?></th>
	</tr>
	<?php
		$i = 0;
		foreach ($copy['Loan'] as $loan):
			$class = null;
			if ($i++ % 2 == 0) {
				$class = ' class="altrow"';
			}
		?>
		<tr<?php echo $class;?>>
			<td><?php echo $loan['id'];?></td>
			<td><?php echo $loan['person_id'];?></td>
			<td><?php echo $loan['user_id'];?></td>
			<td><?php echo $loan['created'];?></td>
			<td><?php echo $loan['modified'];?></td>
			<td><?php echo $loan['estimated_devolution'];?></td>
			<td><?php echo $loan['devolution_date'];?></td>
			<td class="actions">
				<?php echo $this->Html->link(__('View', true), array('controller' => 'loans', 'action' => 'view', $loan['id'])); ?>
				<?php echo $this->Html->link(__('Edit', true), array('controller' => 'loans', 'action' => 'edit', $loan['id'])); ?>
				<?php echo $this->Html->link(__('Delete', true), array('controller' => 'loans', 'action' => 'delete', $loan['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $loan['id'])); ?>
			</td>
		</tr>
	<?php endforeach; ?>
	</table>
<?php endif; ?>

	<div class="actions">
		<ul>
			<li><?php echo $this->Html->link(__('New Loan', true), array('controller' => 'loans', 'action' => 'add'));?> </li>
		</ul>
	</div>
</div>
